package com.dhcc.cdc.io.adm;

import com.dhcc.cdc.busi.dao.CdcEpisodeMapper;
import com.dhcc.cdc.busi.entity.CdcEpisodeEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Date;

@Component
public class CdcEpisodeData{

    @Autowired
    CdcEpisodeMapper episodeMapper;

    public CdcEpisodeEntity getEntity(Long episodeId) {
        CdcEpisodeEntity episode = episodeMapper.selectById(episodeId);
        return episode;
    }
    // 取患者性别
    public String getPatGender(String episodeId) {
        CdcEpisodeEntity episode=getEntity(Long.parseLong(episodeId));
        return episode.getGender();
    }
    // 取患者入院日期
    public Date getAdmDate(String episodeId) {
        CdcEpisodeEntity episode=getEntity(Long.parseLong(episodeId));
        return episode.getAdmDate();
    }

}
